<%@page contentType="text/html; utf-8" language="java" pageEncoding="utf-8" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <script language="JavaScript" src="js/jquery-1.8.3.min.js"></script>
    <script>
        $(function () {
            $("#btn1").click(function () {
                $.post("getAllBook",null,function (data) {
                    var table="<table border='2'><tr><td>标题</td><td>书名</td><td>上传人</td><td>上传时间</td></tr>";
                    for (var i=0;i<data.length;i++){
                        table=table+"<tr><td>"+data[i].title+"</td><td>"+data[i].summary+"</td><td>"+data[i].uploaduser+"</td><td>"+data[i].createdate+"</td><tr>";
                }
                    table=table+"</table>";
                    $("#div01").html(table);
                },"json");
            });
        })
    </script>
</head>
<body>
<input type="button" id="btn1" value="加载"/>
<div id="div01"></div>

</body>
</html>
